

#include <cpp/scope.hpp>

#include "catch.hpp"


TEST_CASE("unique_resource")
{
	using namespace cpp;


	SCOPE_EXITX(x)
	{

	};

	std::ostringstream out{};
	{
		auto guard = make_unique_resource(1, [&](auto) {out << "done\n"; });

	}

	auto file = make_unique_resource_checked(::fopen("nonexistentfile.txt", "r"), nullptr, &::fclose);


	auto file0 = std::move(file);

}
